# Maintainer: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
# Contributor: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
pkgname=opencascade
pkgver=7.4.0
pkgrel=1
pkgdesc="An SDK for development of applications dealing with 3D CAD data"
url="https://dev.opencascade.org/"
arch="x86_64" # Dependency vtk is x86_64 only
license="LGPL-2.1-only"
makedepends="
	cmake
	doxygen
	ffmpeg-dev
	freeimage-dev
	freetype-dev
	libtbb
	libtbb-dev
	libxi-dev
	libxmu-dev
	mesa-dev
	tk
	tk-dev
	vtk-dev
	"
subpackages="$pkgname-doc $pkgname-dev"
source="
	opencascade-$pkgver.tar.gz::https://git.dev.opencascade.org/gitweb/?p=occt.git;a=snapshot;h=refs/tags/V${pkgver//./_};sf=tgz
	no_mallinfo.patch
	no_feenableexcept.patch
	cmake_fix_install_dir.patch
	cmake_add_buildtype_none.patch
	"
builddir="$srcdir/occt-V${pkgver//./_}"
options="!check" # No tests provided :-/

build() {
	mkdir -p build
	cd build
	cmake .. \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DUSE_GL2PS=OFF \
		-DUSE_FREEIMAGE=ON \
		-DUSE_FFMPEG=ON \
		-DUSE_VTK=ON \
		-DUSE_TBB=ON
	make
}

package() {
	cd build
	make DESTDIR="$pkgdir" install
}

sha512sums="eb0d47848d48f42a159ae5d7a4144483ba1f59f634844bd2053e48e04af30a30ba7056112cd38a1730d193a8d736b898f9608dd574cbe6829dbe7257a002772a  opencascade-7.4.0.tar.gz
01ee778de7ef95a479c87445d1d062e5d858879e211d2c312f801133e35f768cc70d00e3f3fae00f39c60473641c78517d16d63425dd2dd7e19f3079d2cf1a51  no_mallinfo.patch
b039b8fce696bfd0f53309a72adab4065780bf1755da6208040157e9383deb0061ad8927a6f160730f431cbebe3fdd1eaa7967b38da4a245a8d9306042d97629  no_feenableexcept.patch
10481f153adf1db55111d68da49dae1885a50e745d3a978f6316b5b13a3f2d7de6a2ed6a3c60c20ef967ea65c16b372da03bf2665ffe4493ad6fe329a3abf368  cmake_fix_install_dir.patch
4bdedc8f0e011530115777cddeeb898750242999725347c3392d8858e5cc9543c791814aa41e1543c575a6a79b0b32fd72970bb83c8948fe42f33993244db1cf  cmake_add_buildtype_none.patch"
